package com.winsdom.entity.count;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel(description = "计费明细分页结果")
public class BillingDetailsPageResult {
    
    @ApiModelProperty("总记录数")
    private long total;
    
    @ApiModelProperty("总页数")
    private long pages;
    
    @ApiModelProperty("当前页码")
    private int pageNum;
    
    @ApiModelProperty("每页数量")
    private int pageSize;
    
    @ApiModelProperty("数据列表")
    private List<BillingDetailsVO> list;
    
    public static BillingDetailsPageResult of(List<BillingDetailsVO> list, long total, int pageNum, int pageSize) {
        BillingDetailsPageResult result = new BillingDetailsPageResult();
        result.setList(list);
        result.setTotal(total);
        result.setPageNum(pageNum);
        result.setPageSize(pageSize);
        result.setPages((total + pageSize - 1) / pageSize);
        return result;
    }
} 